﻿using Abp.Domain.Repositories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Abp.AutoMapper;

namespace MyCompanyName.AbpZeroTemplate.Prm.System
{
    public class DocumentTypeAppService : AbpZeroTemplateAppServiceBase, IDocumentTypeAppService
    {
        IRepository<DocumentType, int> documentTypeRepository;

        public DocumentTypeAppService(IRepository<DocumentType, int> _documentTypeRepository)
        {
            documentTypeRepository = _documentTypeRepository;
        }

        /// <summary>
        /// 文档类型列表
        /// </summary>
        /// <returns></returns>
        public async Task<List<Dto.GetDocumentTypeOutPut>> GetAll()
        {
            var all = await documentTypeRepository.GetAllListAsync();
            var model = all.MapTo<List<Dto.GetDocumentTypeOutPut>>();
            return model;
        }
    }
}
